Skip to main content

Policy Rules

Overview

Policy rules are used to evaluate simple business conditions; an action is executed when the condition is fulfilled. These rules are based on If, Else, and Then logical operators.

  • If contains conditions and can be combined with more than one condition using AND or OR operators.
  • Then contains the actions to be performed when the If condition is met.
  • Else contains the actions to be executed when the If condition is not met. Else can be left blank.

Policies1

Note
The conditions and the execution of actions depend entirely on the Vocabulary definitions.


Procedure to Create Policy Rules:

  1. Go to the fourth step of the Bizagi Process Wizard and select Activity Actions.

    DefiningNotifications4

  2. Click the shape where the policy is to be created and select On Enter, On Save, or On Exit to create the policy.
    Select the Policy item.

    CreatingPolicies1

  3. Click on New on the upper left corner. In the new window, enter a name, display name, and description for the policy.
    Click OK.

    CreatingPolicies2

  4. In the Policy Manager, select New Policy Rule.

    Policies6

  5. A window will open where you can create and edit Policy rules.

    Policies7

  6. Include the condition to be evaluated. Drag and drop Vocabulary definitions to the If condition box on the left.
    Click the Add Condition button to include as many options as necessary to evaluate the rule.

    Policies17

    Note
    The Vocabulary definitions used to create the If and Else conditions can only be defined by Constant or XPath definitions configured to GET a value.

  7. Enter the actions to be performed by dragging the Vocabulary you need to the Then box and assign the required values.

    Policies18

    Note
    Actions can only be defined by Vocabulary created as Constant or XPath definitions configured to SET a value.

    By default, the Else box is hidden but can be enabled by selecting the option Use Else in the upper right corner of the window.
    Drag and drop the relevant Vocabulary to the Else box.

    Policies19

  8. When the Policy Rule is concluded, click Finish.
    You will be asked to include the documentation information:

    • Name: This is the name of the Policy rule in the database. Once saved, it cannot be modified.
    • Display Name: This is the display name of the Policy Rule. You can change it anytime.
    • Description: Include any relevant information that explains the purpose of the policy.
    • Priority: Establishes the relevance with which the Policy rule must be executed.
    • Enabled: Defines if the Policy is enabled or disabled. When a policy is not in use, it can be disabled.
    • Enabled From Date: The Policy rule can be enabled for a specified period of time. This is the From date of that specific period.
    • Enabled To Date: The Policy rule can be enabled for a specified period of time. This is the To date of that specific period.

    Policies20


Example

Imagine you work in a bank and need to create a policy that handles the scenario where a client starts the request application process but does not select any of the financial products offered. If a client does not complete the request, they will be penalized and disallowed from making a new request for a certain period of time.

A Policy is created to penalize the client as the activity finishes where the case is first created.

Policies4


Steps to Create the Policy Rule:

  1. Go to the fourth step of the Bizagi Process Wizard and select Activity Actions.
    Click on the shape where the policy is to be created and select On Enter, On Save, or On Exit to create the policy.
    Select the Policy item.

    CreatingPolicies1

  2. In the Policy Manager, select New Policy Rule.

    Policies6

  3. The Policy Rule window will open where you can create and edit the rule.

    Policies7

  4. Include the condition to be evaluated.
    In this case, the condition will use a Vocabulary that is an XPath definition to obtain the number of records in the Products collection.
    Right-click XPath definitions and select New Definition.

    Policies9

    Type a name, display name, and description for the new Definition.

    Policies8

    Click the Products collection in the data model and then select the Count function from the drop-down list located at the upper right corner.
    Click Next.

    Policies10

    The new XPath definition has been created, and you can select it from the Definitions menu.
    Drag and drop this definition to the first argument of the If condition.

    Policies11

    We will compare if the product count is equal to zero. If it is zero, the client will be penalized. That is, if the XPath definition is equal to 0, no records have been found in the Products collection, and the client must be penalized.

    Policies12

  5. Enter the action when the condition evaluates to TRUE: the request is closed. The Closed attribute must be set to TRUE.

    We need to create a new XPath definition to set a value to the Closed attribute. Repeat the procedure used to create an XPath definition but select it as a SET definition of the action.

    Policies13

    When clicking on Next, you will be asked to select whether the Definition will be used to get or set a value. In this case, we will set a value, so select this option.

    Policies14

    Drag the definition created to the Then box and assign it the TRUE value.

    Policies15

    Click Finish.

  6. Define a name, display name, and description for the new Policy.

    Policies16

The Policy rule has been created.